import 'PricePart.dart';

class PriceSerial{

  String name="";
  String id="";
  String partId="";
  String productSerial="";
  String models="";
  String compressor="";
  String frequency="";
  String remark="";
  String code="";
  String data="";
  List<PricePart> materialList=[];



  PriceSerial();

  PriceSerial.fromJson(Map<String,dynamic> json){
    name=json["name"]??"";
    id=json["id"]??"";
    partId=json["partId"]??"";
    productSerial=json["productSerial"]??"";
    models=json["models"]??"";
    compressor=json["compressor"]??"";
    frequency=json["frequency"]??"";
    remark=json["remark"]??"";
    code=json["code"]??"";
    data=json["data"]??"";
    var materialJson=json["materialList"];
    if(materialJson!=null){
      for(var item in materialJson){
        PricePart part=PricePart.fromJson(item);
        materialList.add(part);
      }
    }
  }

  Map<String,dynamic> toJson(){
    final _data=<String,dynamic>{};
    _data["name"]=name;
    _data["id"]=id;
    _data["partId"]=partId;
    _data["productSerial"]=productSerial;
    _data["models"]=models;
    _data["compressor"]=compressor;
    _data["frequency"]=frequency;
    _data["remark"]=remark;
    _data["code"]=code;
    return _data;
  }
}